home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / misc / xref_v1.1.lha / XRef / Tools / source / aguidexref.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-08  |  6.6 KB  |  178 lines

  1. /*
  2. ** $PROJECT: XRef-Tools
  3. **
  4. ** $VER: aguidexref.h 0.1 (07.08.94)
  5. **
  6. ** by
  7. **
  8. ** Stefan Ruppert , Windthorststraße 5 , 65439 Flörsheim , GERMANY
  9. **
  10. ** (C) Copyright 1994
  11. ** All Rights Reserved !
  12. **
  13. ** $HISTORY:
  14. **
  15. ** 07.08.94 : 000.001 :  initial
  16. */
  17.  
  18. /* ------------------------------- includes ------------------------------- */
  19.  
  20. #include "Def.h"
  21.  
  22. #include <libraries/xref.h>
  23. #include <clib/xref_protos.h>
  24. #include <pragmas/xref_pragmas.h>
  25.  
  26. #include <debug.h>
  27. #include <register.h>
  28.  
  29. #include "/lib/xrefsupport.h"
  30.  
  31. #include <graphics/gfxbase.h>
  32.  
  33. /* ------------------------------- defines -------------------------------- */
  34.  
  35. #define PATH_LEN                 256
  36. #define MAIN_LEN                 128
  37. #define TEMP_LEN                 128
  38.  
  39. #define STRING_LEN               256
  40. #define CATEGORY_LEN              40
  41.  
  42. #define PUDDLE_SIZE              2048
  43. #define TRESH_SIZE               PUDDLE_SIZE
  44.  
  45. /* ------------------------------ Prototypes ------------------------------ */
  46.  
  47. STRPTR tmpname(struct GlobalData *gd);
  48. void insertbyname(struct List *list,struct Node *node);
  49. BOOL parsexref(struct GlobalData *gd);
  50. void getstdargs(struct GlobalData *gd,ULONG *para);
  51.  
  52. extern char *prgname;
  53. extern struct Library *SysBase;
  54.  
  55. /* ------------------------------ structures ------------------------------ */
  56.  
  57. struct Entry
  58. {
  59.    struct Node e_Node;
  60.    LONG e_Type;
  61.    STRPTR e_Name;
  62.    STRPTR e_File;
  63.    STRPTR e_Path;
  64.    STRPTR e_NodeName;
  65.    ULONG e_Line;
  66. };
  67.  
  68. struct MenuDef
  69. {
  70.    UWORD md_MenuType;                  /* NewMenu type */
  71.    ULONG md_MenuTextID;                /* textid for the appStrings[] array or 
  72.                                         * -1 for barlabel */
  73.    UWORD md_MenuFlags;                 /* MenuItem flags */
  74.    UWORD md_MenuCmd;                   /* internal command number for execute_cmd() */
  75. };
  76.  
  77. struct GlobalData
  78. {
  79.    STRPTR gd_XRefFile;                 /* xreffile for the parse */
  80.    ULONG gd_Matching;                  /* matching for the parse */
  81.    ULONG gd_Limit;                     /* limit for entries */
  82.  
  83.    BPTR gd_FileHandle;                 /* filehandle to write all xref links */
  84.  
  85.    struct Entry gd_LastEntry;          /* store entry, if only one is found */
  86.  
  87.    LONG gd_Num;                        /* actual number of xrefs */
  88.    UWORD gd_Column;                    /* actual column */
  89.    UWORD gd_LineLength;                /* maximal linelength */
  90.    UWORD gd_Columns;                   /* number of columns to use */
  91.    UWORD gd_Chars;                     /* chars for each column */
  92.  
  93.    STRPTR gd_Object;                   /* object, on which occured an error */
  94.    ULONG gd_Error;                     /* an exiplict error , not en IoErr() */
  95.    ULONG *gd_Para;                     /* link to the CLI args */
  96.    ULONG gd_TempCount;                 /* counter for the tempory names */
  97.  
  98.    APTR gd_Pool;                       /* pool for sorting entries */
  99.    struct List gd_EntryList;           /* list of all found entries */
  100.  
  101.    struct Screen *gd_Screen;           /* screen to open window */
  102.    struct Window *gd_Window;           /* window for the amigaguide */
  103.  
  104.    UBYTE gd_FileBuffer[PATH_LEN];      /* filename buffer */
  105.    UBYTE gd_MainBuffer[MAIN_LEN];      /* table of contents buffer */
  106.    UBYTE gd_TempBuffer[TEMP_LEN];      /* tempory name buffer */
  107.  
  108.    UBYTE gd_String[STRING_LEN];        /* buffer for the string gadget */
  109.    UBYTE gd_Category[CATEGORY_LEN];    /* buffer for the category */
  110.  
  111.    struct Library *gd_XRefBase;        /* library base for the xref.library */
  112.  
  113. #ifndef OSV37
  114.    UBYTE gd_Directory[PATH_LEN];       /* directory to use */
  115.  
  116.    struct Library *gd_DataTypesBase;   /* library base for the datatypes.library */
  117.    struct Library *gd_GadToolsBase;    /* library base for the gadtools.library */
  118.    struct Library *gd_GfxBase;         /* library base for the graphics.library */
  119.    struct Library *gd_DiskFontBase;    /* library base for the diskfont.library */
  120.    struct Library *gd_AslBase;         /* library base for the asl.library */
  121.    struct Library *gd_LocaleBase;      /* library base for the locale.library */
  122.  
  123.    struct Catalog *gd_Catalog;         /* locale catalog to use */
  124.  
  125.    BOOL gd_Running;                    /* aguidexref running ? */
  126.    ULONG gd_Flags;                     /* some flags see below */
  127.  
  128.    struct DrawInfo *gd_DrawInfo;       /* screen drawinfo */
  129.    APTR gd_VisualInfo;                 /* gadtools visualinfo structure */
  130.    struct NewMenu *gd_NewMenu;         /* gadtools menu structure */
  131.    struct Menu *gd_Menu;               /* menu for the window */
  132.  
  133.    Object *gd_AGObject;                /* AmigaGuide Object */
  134.    BOOL gd_ObjectAdded;                /* object is added to the window */
  135.    struct IBox gd_ObjectBox;           /* rectangle for the amigaguide object */
  136.  
  137.    struct NewGadget gd_NewGadget;      /* NewGadget struct for CreateGadgetA() */
  138.    UWORD gd_OldFHeight;                /* old screen font height */
  139.  
  140.    ULONG gd_NumGadgets;                /* number os actual gadgets */
  141.  
  142.    struct Gadget *gd_FirstGadget;      /* Gadget Pointer for CreateGadgetA() */
  143.    struct Gadget *gd_CategoryGad;      /* pointer to the category gadget */
  144.    struct Gadget *gd_StringGad;        /* pointer to the string gadget */
  145.    struct Image *gd_Images[4];         /* arrow button images */
  146.    struct Gadget *gd_Buttons[4];       /* arrow button gadgets */
  147.    struct Gadget *gd_HorizProp;        /* horizontal slider */
  148.    struct Gadget *gd_VertProp;         /* vertical slider */
  149.  
  150.    struct TextFont *gd_TextFont;       /* pointer to the TextFont structure */
  151.    struct TextAttr gd_TextAttr;        /* textfont to use for the datatype object */
  152.  
  153.    /* preference entries */
  154.  
  155.    UBYTE gd_FontName[MAXFONTNAME];     /* font to use */
  156.  
  157.    struct IBox gd_InitialRect;         /* initial window rectangle */
  158.    struct IBox gd_WindowRect;          /* window rectangle */
  159.    struct IBox gd_WindowAltRect;       /* window alternate rectangle */
  160. #endif
  161. };
  162.  
  163. #define GDF_FORCEFONT      (1<<0)      /* font is specified via ReadArgs(), thus
  164.                                           don't use the font in the prefs file */
  165. #define GDF_SYNC           (1<<1)      /* use DTA_Sync instead of the OM_UPDATE
  166.                                           method */
  167.  
  168. /* redirect library bases to global data structure */
  169.  
  170. #define XRefBase                       gd->gd_XRefBase
  171. #define DataTypesBase                  gd->gd_DataTypesBase
  172. #define GadToolsBase                   gd->gd_GadToolsBase
  173. #define GfxBase                        gd->gd_GfxBase
  174. #define DiskFontBase                   gd->gd_DiskFontBase
  175. #define AslBase                        gd->gd_AslBase
  176. #define LocaleBase                     gd->gd_LocaleBase
  177.  
  178.